#include <stdio.h>
#include <ctype.h>
#include <string.h>
void Fibonacci(int *a, int *b);
int main()
{
    int a, b, c;
    scanf("%d", &a);
    scanf("%d", &b);
    scanf("%d", &c);
    printf("%5d %5d %5d\n", a, b, c);
    for (int i = 1; i < c; i++)
    {
        Fibonacci(&a,&b);
    }
    printf("%5d\n", a);
    return 0;
}
void Fibonacci(int *d, int *e)
{
    int temp=*e;
    *e=*e+*d;
    *d=temp;
}